package com.kaishengit.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.kaishengit.pojo.Idea;
import com.kaishengit.pojo.Project;

@Repository
public class IdeaDao extends BaseDao<Idea, String>{

	public  List<Idea> findByProject(Project project) {
		String hql = "from Idea where projectid = :id Order by createtime desc" ;
		Query query = getSession().createQuery(hql);		
		query.setParameter("id", project);
		
		@SuppressWarnings("unchecked")
		List<Idea> ideaList=query.list();
		return ideaList;
	}
	
}
